﻿<div ms-controller="tempview">

    <div class="sui-form form-inline" style="padding-top:5px;">
     
        <input type="text" ms-duplex="searchkey" placeholder="关键字搜索" class="input-large input-xfat" />
        <a class="sui-btn btn-large btn-primary" style="margin-left:10px;" ms-click="GetLIST()">查询</a>
       
    </div>

    <div>
        <table class="sui-table table-primary table-zebra">
            <thead>
                <tr>
                    <th>订单号</th>
                    <th>装车地址</th>
                   
                    <th>收货人姓名</th>
                    <th>身份证号码</th>
                    <th>联系电话</th>
                    <th>卸货地址</th>
                    <th>楼层</th>
                    <th>是否自带搬运工</th>
                    <th>搬运费</th>
                    <th>车辆</th>
                    <th>详情</th>

                </tr>
            </thead>
            <tbody>
                <tr ms-repeat-el="ListData">
                    <td>{{el.ORDERID}}</td>
                    <td>{{el.PUTONADD}}</td>

                    <td>{{el.RECEIVER}}</td>
                    <td>{{el.RECEIVEPHONE}}</td>
                    <td>{{el.RECEIVERID}}</td>
                    <td>{{el.DOWNADD}}</td>
                    <td>{{el.DOWNFLOOR}}</td>
                    <td>{{el.PUTDOWMODE}}</td>
                    <td>{{el.PUTDOWNFEE}}</td>
                    <td>{{el.CARID}}</td>
                    <td><a href="javascript:void(0)" ms-click="Detail(el)" >调度</a></td>
                    <!--<td><a href="javascript:void(0)" ms-click="Detail(el)" ms-if="im.Status==1">调度</a></td>-->
                </tr>
            </tbody>
        </table>
    </div>

   

</div>
<script type="text/javascript">
    var tempmodel = avalon.define({
        $id: "tempview",
        searchkey: "",
        Type2: "",
        TypeList1: [],
        TypeList2: [],
        IsShelf: "",
        ToTop:"",
        Init: function () {
            $.getJSON("/adapi/base/cate/list/1/0", function (r) {
                tempmodel.TypeList1 = r.result;
            })
            tempmodel.GetLIST();
        },
        GetLIST: function () {
            model.page.pageindex = 1;
            model.ListData.clear();
            $.getJSON("/adapi/base/order/list", { pageindex: model.page.pageindex, pagesize: model.page.pagesize, "searchkey": model.searchkey}, function (r) {
                if (r.error == "") {
                    model.ListData = r.result;
                    model.total = r.total;

                    $("#pageDiv").pagination({  //分页容器
                        styleClass: ['sui-pagination'],  //分页样式
                        //showCtrl: false,
                        displayPage: 6,
                        itemsCount: r.total,
                        pageSize: model.page.pagesize,
                        onSelect: function (num) {
                            model.page.pageindex = num;
                            $.getJSON("/adapi/base/order/list", { pageindex: model.page.pageindex, pagesize: model.page.pagesize, "searchkey": model.searchkey}, function (r) {
                                model.ListData.clear();
                                model.ListData = r.result;
                            })
                        }
                    })

                    $('#pageDiv').pagination('updateItemsCount', r.total, 1);
                }
            })
        },
        Detail: function (el) {

            top.ComFunJS.winShowForm("/admin/base/add.html?funcode=wl_transfer&v=1&order=" + el.ORDERID + "&beginadd=" + el.PUTONADD, "维护调度信息");

            //top.ComFunJS.winShowFormBtn("维护调度信息", "/admin/base/add.html?funcode=wl_transfer&v=1&order=" + el.ORDERID + "&beginadd=" + el.PUTONADD, "800", "600", function (layero, layindex) {

            //    //var body = top.layer.getChildFrame('body', layindex);
            //    //var sendtype = body.find("#sendtype").val();
            //    //var sendkd = body.find("#sendkd").val();
            //    //var sendno = body.find("#sendno").val();
            //    //if (sendtype == "0" && !sendno) {
            //    //    top.ComFunJS.winShowMsg("请输入快递单号");
            //    //    return;
            //    //}

            //    //$.getJSON("/adapi/order/send/" + el.ID, { sendtype: sendtype, sendkd: sendkd, sendno: sendno }, function (r) {
            //    //    if (r.error == "") {
            //    //        el.Status = 2;
            //    //        el.ExpressName = r.result.ExpressName;
            //    //        el.ExpressNo = r.result.ExpressNo;
            //    //        el.SendTime = r.result.SendTime;
            //    //        top.ComFunJS.close(layindex);
            //    //        top.ComFunJS.winShowMsg("发货成功");
            //    //    } else {
            //    //        top.ComFunJS.winShowAlert(r.error);
            //    //    }

            //    //})

            //})
        }


    })



</script>

